//
//  FMSServerAPI.h
//  FMS
//
//  Created by Steven on 10/19/13.
//  Copyright (c) 2013 QGSVN. All rights reserved.
//

#import "AFHTTPClient.h"
typedef enum {
    ServerResponsePlanText,
    ServerResponseTypeJSON
} ServerResponseType;

@interface FMSServerAPI : NSObject{
    NSString *_userName;
    NSString *_password;
}
@property (nonatomic, copy) NSString *baseURL;
@property (nonatomic, assign) ServerResponseType responseType;
@property(nonatomic, copy) void(^completionBlock)(NSDictionary*,NSString*);
@property(nonatomic, copy) void(^errorBlock)(NSDictionary* error,NSString*);

+ (FMSServerAPI *)shareClient;
+ (FMSServerAPI *)changeServerLink:(NSString *)serverLink;

//ser info authentication
- (void)setUserName:(NSString *)userName password:(NSString *)password;

// server methods
- (void)getDomainInfo:(NSString *)virtualHost successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

- (void)getCompanyId:(NSString *)virtualHost successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

//get user info in sql
- (void)getUserInfoAuthenticationUserEmail:(NSString *)userEmail password:(NSString *)password fromCompnay:(int)companyId success:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
//get time duration to limit data
- (void)getTimeDurationSuccess:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
//check permission user login
- (void)checkPermissionUser:(NSString *)user auth:(NSString *)auth success:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

//get user info
- (void)loginWithUser:(NSString *)userEmail password:(NSString *)password successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
//forgot password user
- (void)forgotPasswordEmail:(NSString *)userEmail successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
//get owner info by email
- (void)getOwnerUserInfoByEmail:(NSString *)email success:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

//get all building
- (void)getAllBuildingSuccesss:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

//get building info by Id
- (void)getBuildingInfoByBuidingId:(NSString *)buildingId successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

// get building info by name
- (void)getBuildingInfoByName:(NSString *)buildingName successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;

// get eForm
- (void) getEformByType:(NSMutableDictionary*)_argument successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
- (void) saveEform:(NSMutableDictionary*)_arguments successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
- (void) getDetailedEform:(NSMutableDictionary*)_argument successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
- (void) sendEmailMaintenance:(NSMutableDictionary*)_arguments successs:(void (^)(id response))successs failure:(void (^)(NSError *error))failure;
@end
